import { v4 as uuidv4 } from 'uuid';
// 封装临时id
export function getUserTempId(){
    // 获取本地存储的临时id
    let userTempId = localStorage.getItem("userTempId")
    if(userTempId){
        // 如果有临时id  返回
        return userTempId
    }else{
        // 生成临时id
        let newUserTempId = uuidv4()
        // 临时id存储本地
        localStorage.setItem("userTempId",newUserTempId)
        return newUserTempId
    }
}